<?php

class TAppCore 
{
    // Expiration time for user's session
    public         $sessionExpirationTimeSec  = 3600; // 1 Hour
    // Value for the session's cookie which is sent to the browser
    public         $sessionName               = 'AppSession';
    
    /***************************************************************************
    * start
    ***************************************************************************/
    public function start()
    {
        $this->startSession();
        
    }
    
    /***************************************************************************
    * startSession
    ***************************************************************************/
    private function startSession()
    {
        session_set_cookie_params( $this->sessionExpirationTimeSec );
        session_name( $this->sessionName );
        session_start();

        // Reset the expiration time upon page load
        if ( isset( $_COOKIE[ $this->sessionName ] ) )
        {
            setcookie( $this->sessionName, $_COOKIE[ $this->sessionName ], time() + $this->sessionExpirationTimeSec );
        }
    }
    
    /***************************************************************************
    * startSession
    ***************************************************************************/
    public function isUserAuthorised()
    {
    
    }
}

?>